<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改采购单')" />
    <th:block th:include="include :: datetimepicker-css" />
    <th:block th:include="include :: bootstrap-fileinput-css"/>
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-purchase-edit" th:object="${gysptPurchase}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-2 control-label is-required">编号：</label>
                <div class="col-sm-4">
                    <input name="orderNo" th:field="*{orderNo}" class="form-control" type="text" autoComplete="off" required>
                </div>
                <label class="col-sm-2 control-label is-required">名称：</label>
                <div class="col-sm-4">
                    <input name="name" th:field="*{name}" class="form-control" type="text" autoComplete="off" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-2 control-label is-required">申请日期：</label>
                <div class="col-sm-4">
                    <div class="input-group date">
                        <input name="startAt" th:value="${#dates.format(gysptPurchase.startAt, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text" autoComplete="off" required>
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
                <label class="col-sm-2 control-label is-required">申请人：</label>
                <div class="col-sm-4">
                    <input name="owner" class="form-control" th:field="*{owner}" readonly="readonly" type="text" autoComplete="off" required>
                	<input name="owneId" th:field="*{owneId}" type="hidden">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-2 control-label is-required">申请部门：</label>
                <div class="col-sm-4">
                    <input name="dept" class="form-control" type="text" th:field="*{dept}" autoComplete="off" readonly="readonly" required>
                    <input name="deptId" th:field="*{deptId}" type="hidden">
                </div>
                <label class="col-sm-2 control-label is-required">供应商：</label>
                <div class="col-sm-4">
                    <select id="supplyId" name="supplyId" th:field="*{supplyId}" class="form-control" required>
						<option th:each="cl:${sylis}" th:value="${cl.id}" th:text="${cl.name}"></option>
					</select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label is-required">事由：</label>
                <div class="col-sm-10">
                    <textarea name="descs" class="form-control" autoComplete="off" required>[[*{descs}]]</textarea>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <th:block th:include="include :: bootstrap-fileinput-js"/>
    <script th:inline="javascript">
        var prefix = ctx + "gcgl/purchase";
        $("#form-purchase-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-purchase-edit').serialize());
            }
        }

        $("input[name='startAt']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

    </script>
</body>
</html>